test(web): add unit tests for isDeploymentRunning utility - #7145
Conversation
|
👋 Hi @vikash7485, welcome to PipeCD and thanks for opening your first pull request! We’re really happy to have you here Before your PR gets merged, please check a few important things below. Helpful resources
DCO Sign-offAll commits must include a In case you forget to sign-off your commit(s), follow these steps: For the last commit: git commit --amend --signoff
git push --force-with-leaseFor multiple commits: git rebase --signoff origin/master
git push --force-with-leaseRun checks locallyBefore pushing updates, please run: make checkThis runs the same checks as CI and helps catch issues early. 💬 Need help?If anything is unclear, feel free to ask in this PR or join us on the CNCF Slack in the #pipecd channel. Thanks for contributing to PipeCD! ❤️ |
2ffa638 to
f5ccc5b
Compare
rahulshendre
left a comment
There was a problem hiding this comment.
the 7 cases could fold into one it.each table, we can trim the repetition.
Also Fixes #6915 is not really correct - that's the Snyk alpine upgrade PR, please fix it.
Add unit tests for all 7 DeploymentStatus enum variants (PENDING, PLANNED, RUNNING, ROLLING_BACK, SUCCESS, FAILURE, CANCELLED) plus the undefined edge case. This brings the utility from 0% to 100% branch coverage. Related: pipe-cd#6706 Signed-off-by: vikash7485 <vikkiraj073@gmail.com>
164b755 to
f7e3959
Compare
✅ Deploy Preview for pipecd-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #7145 +/- ##
===========================================
- Coverage 47.06% 28.77% -18.30%
===========================================
Files 172 501 +329
Lines 16719 55860 +39141
===========================================
+ Hits 7869 16071 +8202
- Misses 8288 38465 +30177
- Partials 562 1324 +762 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thank you for contributing to PipeCD, @vikash7485! The changes in this pull request will be part of the upcoming release! |
What this PR does:
Add unit tests for
isDeploymentRunninginweb/src/utils/is-deployment-running.ts, covering all 7DeploymentStatusenum values and theundefinededge case.Why we need it:
This utility has zero test coverage despite being a critical decision function called in:
DeploymentDetailPage(controls polling interval)DeploymentDetail(controls cancel button visibility)Pipelinecomponent (determines if stages are interactive)Without tests, future enum additions to
DeploymentStatuscould silently break polling behavior with no regression signal.Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:
No. This PR only adds test coverage for an existing utility function.